﻿using WPFExcelReport.Helpers;
using System;
using System.Collections.Generic;
using System.Data;
namespace WPFExcelReport
{
    public partial class VGASTGA
    {
        public readonly static VGASTGA Instance = new VGASTGA();
        private string _CART; public string CART { get { return _CART; } set { _CART = value; OnPropertyChanged("CART", value); } }
        public int LOAD(Dictionary<string, Object> pm)
        {
            dwData = TBMain.NewRow();
            string _art = (string)pm["CART"];
            dwData["GAGMANDANT"] = app.Mandant;
            dwData["GAGART"] = Helpers.Helper.Left(_art, 20);
            dwData["GAGVAR"] = _art.Substring(20, 3);
            dwData["GAGFARBE"] = Helper.Right(_art, 10);
            SResult = QGG04(dwData);
            MergeData(SResult, true);
            return TBMain.Rows.Count;
        }
        public string GETPOS(DataRow dwData)
        {
            SResult = QGG11(dwData);
            foreach(DataRow row in SResult.Tables[0].Rows)
            {
                POS =Helper.Right("00"+(Convert.ToInt16(row["POS"].ToString()) + 1).ToString(),2);
            }
            return POS;
        }
    }
    public partial class VGASTGA
    {

        public string GAGMANDANT { get { if (dwMaster == null) return ""; return dwMaster["GAGMANDANT"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGMANDANT"] = value; OnPropertyChanged("GAGMANDANT", value); } } //lENGth 2
        public string GAGART { get { if (dwMaster == null) return ""; return dwMaster["GAGART"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGART"] = value; OnPropertyChanged("GAGART", value); } } //lENGth 20
        public string GAGVAR { get { if (dwMaster == null) return ""; return dwMaster["GAGVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGVAR"] = value; OnPropertyChanged("GAGVAR", value); } } //lENGth 3
        public string GAGFARBE { get { if (dwMaster == null) return ""; return dwMaster["GAGFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGFARBE"] = value; OnPropertyChanged("GAGFARBE", value); } } //lENGth 10
        public string GAGPOS { get { if (dwMaster == null) return ""; return dwMaster["GAGPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGPOS"] = value; OnPropertyChanged("GAGPOS", value); } } //lENGth 2
        public string GAGGART { get { if (dwMaster == null) return ""; return dwMaster["GAGGART"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGGART"] = value; OnPropertyChanged("GAGGART", value); } } //lENGth 20
        public string GAGGVAR { get { if (dwMaster == null) return ""; return dwMaster["GAGGVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGGVAR"] = value; OnPropertyChanged("GAGGVAR", value); } } //lENGth 3
        public string GAGGFARBE { get { if (dwMaster == null) return ""; return dwMaster["GAGGFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGGFARBE"] = value; OnPropertyChanged("GAGGFARBE", value); } } //lENGth 10
        public double GAGABF { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GAGABF"].ToString()); } set { if (dwMaster == null) return; dwMaster["GAGABF"] = value; OnPropertyChanged("GAGABF", value); } } //lENGth 0
        public string GAGKGNET { get { if (dwMaster == null) return ""; return dwMaster["GAGKGNET"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGKGNET"] = value; OnPropertyChanged("GAGKGNET", value); } } //lENGth 10
        public string GAGKGBRUT { get { if (dwMaster == null) return ""; return dwMaster["GAGKGBRUT"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGKGBRUT"] = value; OnPropertyChanged("GAGKGBRUT", value); } } //lENGth 10
        public string GAGDISPOKZ { get { if (dwMaster == null) return ""; return dwMaster["GAGDISPOKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGDISPOKZ"] = value; OnPropertyChanged("GAGDISPOKZ", value); } } //lENGth 1
        public string GAGBEM { get { if (dwMaster == null) return ""; return dwMaster["GAGBEM"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGBEM"] = value; OnPropertyChanged("GAGBEM", value); } } //lENGth 20
        public double GAGFDZANZ { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GAGFDZANZ"].ToString()); } set { if (dwMaster == null) return; dwMaster["GAGFDZANZ"] = value; OnPropertyChanged("GAGFDZANZ", value); } } //lENGth 0
        public double GAGANTEIL { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GAGANTEIL"].ToString()); } set { if (dwMaster == null) return; dwMaster["GAGANTEIL"] = value; OnPropertyChanged("GAGANTEIL", value); } } //lENGth 0
        public double GAGBASIS { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["GAGBASIS"].ToString()); } set { if (dwMaster == null) return; dwMaster["GAGBASIS"] = value; OnPropertyChanged("GAGBASIS", value); } } //lENGth 0
        public string GAGFILLER { get { if (dwMaster == null) return ""; return dwMaster["GAGFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["GAGFILLER"] = value; OnPropertyChanged("GAGFILLER", value); } } //lENGth 35

    }
}
